/************************* File Information ****************************
 * Copyright(C): This is my company secrecy java source code. Any copy or change
 * from this file must agreed by my company.
 *
 ************************* History **********************************
 * Create: zhou.h.m,  Date: 2009-8-5.
 * Create Description
 *
 *  $Id$
 *
 ************************* To  Do ***********************************
 *
 ************************* Others ***********************************
 * Add anything you want to write here.
 * 
 * 
 ******************************************************************
 */
package sac.xsd.comm;

import sac.mainmid.MainMID;
import cldc.xsd.cpth.CptHPacketParse;
import cldc.xsd.parse.IPacket;

/**
 * @author zhou.h.m
 */
public class CptHHttpClient extends HttpClient {

	
	static CptHHttpClient instance;
	
	//must create the instance before using it.
	public static void createInstance() {
		instance = new CptHHttpClient();
	}
	
	public static CptHHttpClient getInstance() {
		return instance;
	}
	
	private CptHHttpClient() {
		super(MainMID.getFirstResource("login"));
	}

	public String encode(IPacket packet) {
		return CptHPacketParse.encode(packet);
	}

	public IPacket parse(String text) throws Exception {
		return CptHPacketParse.parse(text);
	}

}
